﻿using System;

namespace Zo.Events.Default
{
    /// <summary>
    /// 默认事件队列。
    /// </summary>
    public class DefaultEventQueue : IEventQueue
    {
        public event EventHandler<DefaultEventProcessedEventArgs> EventPushed;

        public DefaultEventQueue()
        {
        }

        public void Push(IEvent @event)
        {
            OnMessagePushed(new DefaultEventProcessedEventArgs(@event));
        }

        private void OnMessagePushed(DefaultEventProcessedEventArgs e) => EventPushed?.Invoke(this, e);
    }
}